package memberController;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import vo.MemberVo;
import dao.MemberDao;

@Controller
public class MemberJoinController {
	
	@Autowired
	MemberDao mdao;

	@RequestMapping(value="/project/member/member_join.do")
	public ModelAndView exe(MemberVo mvo) throws Exception {	
		
		System.out.println(mvo.getM_no());
		
		System.out.println(mvo.getM_name());
		System.out.println(mvo.getM_id());
		System.out.println(mvo.getM_pwd());
		System.out.println(mvo.getM_birth_y());
		System.out.println(mvo.getM_birth_m());
		System.out.println(mvo.getM_birth_d());
		System.out.println(mvo.getM_pwd_hint());
		System.out.println(mvo.getM_pwd_answer());
		System.out.println(mvo.getM_sex());
		System.out.println(mvo.getM_mail());
		System.out.println(mvo.getM_hp());
		System.out.println(mvo.getM_alias());
		System.out.println(mvo.getM_zipcode());
		System.out.println(mvo.getM_addr1());
		System.out.println(mvo.getM_addr2());
		
		
		mdao.memberJoin(mvo);
		
		ModelAndView mv = new ModelAndView();
		mv.addObject("menu_no","2");
		mv.addObject("state","list");
		mv.setViewName("redirect:../main/community_main.do");
		return mv;
	}

}